Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | "use strict"; |
||
12 | 1 | module.exports = response => { |
|
13 | 7 | let body = response.getBody(); |
|
14 | 7 | if (typeof body === 'string') { |
|
15 | 6 | const extra = body.length > 100 |
|
16 | ? ' ...' |
||
17 | : ''; |
||
18 | 6 | const userFriendlyBody = body.slice(0, 100); |
|
19 | 6 | body = `${userFriendlyBody}${extra}`; |
|
20 | } |
||
21 | |||
22 | 7 | return { |
|
23 | body: body, |
||
24 | statusCode: response.getStatusCode(), |
||
25 | headers: response.getHeaders(), |
||
26 | request: response.getRequest() instanceof Request |
||
27 | ? requestFormatter(response.getRequest()) |
||
28 | : response.getRequest() |
||
29 | }; |
||
30 | }; |
||
31 |